﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MMDemo
{
    public partial class SysSkinForm : Form
    {
        public SysDataStructsForm dataStructsForm;
        private bool IsStart = true;
        public SysSkinForm(SysDataStructsForm dataForm)
        {
            dataStructsForm = dataForm;
            InitializeComponent();
        }

        private void SkinForm_Load(object sender, EventArgs e)
        { 
            SysMainForm.skinh.DetachEx(this.Handle);
            dataStructsForm.skin.SubclassWindowEx(this.Handle, 1000, "changeskin");
            SysMainForm.skinh.DetachEx(button1.Handle);
            dataStructsForm.skin.SubclassWindowEx(button1.Handle, 2005, "btn.change.skin.close");

            SysMainForm.skinh.DetachEx(radioButton1.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton1.Handle, 2004, "radio.skin.11");
            SysMainForm.skinh.DetachEx(radioButton2.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton2.Handle, 2004, "radio.skin.22");
            SysMainForm.skinh.DetachEx(radioButton3.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton3.Handle, 2004, "radio.skin.33");
            SysMainForm.skinh.DetachEx(radioButton4.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton4.Handle, 2004, "radio.skin.44");
            SysMainForm.skinh.DetachEx(radioButton5.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton5.Handle, 2004, "radio.skin.55");
            SysMainForm.skinh.DetachEx(radioButton6.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton6.Handle, 2004, "radio.skin.66");
            SysMainForm.skinh.DetachEx(radioButton7.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton7.Handle, 2004, "radio.skin.77");
            SysMainForm.skinh.DetachEx(radioButton8.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton8.Handle, 2004, "radio.skin.88");
            SysMainForm.skinh.DetachEx(radioButton9.Handle);
            dataStructsForm.skin.SubclassWindowEx(radioButton9.Handle, 2004, "radio.skin.99");
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(1);
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(2);
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(3);
        }

        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(4);
        }

        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(5);
        }

        private void radioButton6_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(6);
        }

        private void radioButton7_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(7);
        }

        private void radioButton8_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(8);
        }

        private void radioButton9_CheckedChanged(object sender, EventArgs e)
        {
            if (IsStart)
            {
                IsStart = false;
                return;
            }
            dataStructsForm.SetTitleBackground(9);
        }

        private void SkinForm_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
